#include<iostream>

using namespace std;


int main()
{
	//char ch = 1 + '0';

	string ch ="0";
	ch += "->";
	ch += -34 + '0';
	cout << ch;

	return 0;
}

/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode() : val(0), left(nullptr), right(nullptr) {}
 *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
 *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
 * };
 */
class Solution {
public:
    vector<string> ret;
    vector<string> binaryTreePaths(TreeNode* root) {
        string path;
        dfs(root, path);
        return ret;
    }

    void dfs(TreeNode* node, string path)
    {
        if (node->left == nullptr && node->right == nullptr)
        {
            path += to_string(node->val);
            ret.push_back(path);
            return;
        }
        path += to_string(node->val);
        path += "->";
        if (node->left)dfs(node->left, path);

        if (node->right)dfs(node->right, path);
    }
};